package com.smarttable.ysd;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.umeng.analytics.MobclickAgent;

public class UserManagerActivity extends AppCompatActivity {

    private ListView mListView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_manager);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
//        toolbar.setNavigationIcon(R.drawable.back_selector);
//        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                finish();
//            }
//        });
        mListView = (ListView)this.findViewById(R.id.listView);
//        String[] content = new String[]{getString(R.string.userGuide),getString(R.string.adminEtrance)};
        String[] content = new String[]{getString(R.string.adminEtrance)};
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.user_manager_item,content);
        mListView.setAdapter(adapter);
        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//                if(position == 0){
//                    Intent intent = new Intent();
//                    intent.setClass(UserManagerActivity.this,UserGuideActivity.class);
//                    UserManagerActivity.this.startActivity(intent);
//                }else if (position == 1){
//                    Intent intent = new Intent();
//                    intent.setClass(UserManagerActivity.this,UnlockGesturePasswordActivity.class);
//                    UserManagerActivity.this.startActivity(intent);
//                }
                if(position == 0){
                    Intent intent = new Intent();
                    intent.setClass(UserManagerActivity.this,UnlockGesturePasswordActivity.class);
                    UserManagerActivity.this.startActivity(intent);
                }
            }
        });
    }

    @Override
    protected void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
    }

}
